<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <!-- 双向数据绑定 -->
    <!-- 1.当视图发生变化时,数据也跟着变化 -->
    <!-- 2.当数据发生变化时,视图也跟着变化 -->
    <div id="app">
        <p>
            用户名:
            <input type="text" v-model="username">
        </p>
    </div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                username: ''
            }
        });
    </script>
</body>

</html>